This invention relates generally to data compression and more particularly to a method and system for decoding a compressed data file.
Some sounds cannot be perceived as accurately by the human ear as other sounds, and some sounds cannot be perceived by the human ear at all. Therefore, a digital representation of an audio signal may be compressed by taking advantage of these properties of the human ear and allocating more bits of data to represent the sounds that a human ear can more readily perceive and less bits of data to represent the sounds that a human ear can less readily perceive. A standard digital audio encoded signal format has been set forth by the Motion Picture Experts Group for this type of compression. This format is commonly referred to as xe2x80x9cMPEG Audio.xe2x80x9d
In a typical compression, the data is divided by an encoder into a number of segments called frames. The encoder also adds overhead data to the beginning of each frame that provides information about the audio data in that frame, such as identification, layer, protection, bit rate, etc. The overhead data generally begins with a synchronization word (syncword) as a signal to a decoder that a new frame is beginning. The decoder searches for a syncword from which to begin decoding during the initial decoding process, or when recovering from an error or switching channels.
Conventional techniques used to find and verify the validity of possible syncwords generally rely on an extended buffer to store a large section of a data stream. This stored section of the data stream is searched for possible syncwords and used to verify the validity of those possible syncwords. This reliance on an extended buffer is a problem because extended buffers are more costly and on-chip memories in general are relatively small. In addition, when the stored section includes a long string of possible syncwords, processing to verify all of the possible syncwords prolongs recovery time and may cause buffer overflow.
In accordance with the present invention, a method and system for decoding a compressed data file are provided that substantially eliminate or reduce disadvantages and problems associated with previously developed systems and methods. In particular, the present invention uses a known data value that is fixed in relation to valid synchronization words (syncwords) to identify and eliminate many false syncwords from verification processing.
In one embodiment of the present invention, a data file having a plurality of frames is received. Each frame has a syncword located at a first predefined length from a known data value that is inconsistent with a data pattern of the syncword. A data string including a plurality of potential syncwords is identified in the data file. A first portion of the data string in excess of a second predefined length is skipped from syncword verification processing. The second predefined length includes the first predefined length plus the length of the syncword. A second remaining portion of the data string is processed for syncword verification.
Technical advantages of the present invention include providing an improved method and system for decoding a compressed data file. In particular, many false syncwords are identified and eliminated from verification processing using a known data value that is fixed in relation to a valid syncword. Accordingly, verification processing of false syncwords that may prolong recovery or render recovery impossible when decoding a compressed data file is reduced.